<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>客户查询管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {
		$("#exportPage").submit(function(){
			var ids = $("#customerIds").val();
			if(ids.length<=0){
				alert("没有需要导出的客户");
				return false;
			}
		});
	});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active">
			<a href="javascript:void(0)">我的收藏列表</a>
		</li>
		<shiro:hasPermission name="findcustomer:findCustomer:edit">
			<li>
				<a href="${ctx}/crm/findcustomer/findCustomer/form">添加客户</a>
			</li>
		</shiro:hasPermission>
	</ul>
	<form:form style="display:none" id="searchForm" modelAttribute="findCustomer" action="${ctx}/crm/findcustomer/findCustomer/searchCustomer" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}" />
	</form:form>
	<form id="exportPage" style="margin-left: 20px;" action="${ctx}/crm/findcustomer/findCustomer/exportAll">
		<input type="hidden" id="customerIds" name="customerIds" value='<c:forEach items="${page.list }" var="customer">
			${customer.id },
		</c:forEach>' />
		<input id="export" class="btn btn-primary" type="submit" value="导出" />
	</form>
	<sys:message content="${message}" />
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>公司名</th>
				<th>地址</th>
				<th>状态</th>
				<th>添加人</th>
				<th>添加时间</th>
				<th>最后修改人</th>
				<th>最后修改时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.list}" var="findCustomer">
				<tr>
					<td>
						<a href="${ctx}/crm/findcustomer/findCustomer/form?id=${findCustomer.id}"> ${findCustomer.name} </a>
					</td>
					<td>${findCustomer.address}</td>
					<td>${findCustomer.statusId}</td>
					<td>${findCustomer.createUser}</td>
					<td>
						<fmt:formatDate value="${findCustomer.createDate}" pattern="yyyy-MM-dd HH:mm:ss" />
					</td>
					<td>${findCustomer.updateUser}</td>
					<td>
						<fmt:formatDate value="${findCustomer.updateDate}" pattern="yyyy-MM-dd HH:mm:ss" />
					</td>
					<td>
						<a href="${ctx}/crm/findcustomer/findCustomer/cacleCollect?customerId=${findCustomer.id}" onclick="return confirmx('确认吗？', this.href)">释放</a>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>